package com.xjscrm.server.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjscrm.common.entity.WwCustomer;
import com.xjscrm.common.entity.WwGroup;
import com.xjscrm.server.dto.wwcustomer.WwCustomerQuery;
import com.xjscrm.server.dto.wwgroup.WwGroupQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface WwGroupMapper {
    int deleteById(Long id);

    int insert(WwGroup record);

    int insertSelective(WwGroup record);

    WwGroup selectById(Long id);

    /**
     * 通过群wxid查询单条数据
     *
     * @param groupWxid 群wxid
     * @return 实例对象
     */
    WwGroup queryByDeviceUniqueIdAndGroupWxid(@Param("deviceUniqueId") Long deviceUniqueId, @Param("groupWxid") String groupWxid);


    int updateByIdSelective(WwGroup record);

    int updateById(WwGroup record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<WwGroup> findByList(Page<WwGroup> page, @Param("query") WwGroupQuery query);
}